﻿
using B.S.Passport.ErrorCode;
using MediatR;

namespace B.S.Passport.Write.API.Application.PurchaseOrdername
{
    public class PurchaseOrderCommand: IRequest<ApiResult<object>>
    {
         public string Command { get; set; }  // 必填字段
        public string? PurchaseOrderNumber { get; set; }
        /// <summary>
        /// 单据类型
        /// </summary>
        public string? BillType { get; set; }
        /// <summary>
        /// 关联订单号
        /// </summary>
        public string? AssociatedorderNumber { get; set; }
        /// <summary>
        /// 供应商名
        /// </summary>
        public string? SupplierName { get; set; }
        /// <summary>
        /// 客户客户名称
        /// </summary>
        public string? CustomerName { get; set; }
        /// <summary>
        /// 联系人
        /// </summary>
        public string? ContactPerson { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string? Phone { get; set; }
        /// <summary>
        /// 收货日
        /// </summary>
        public DateTime? ReceiveDate { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }
        /// <summary>
        /// 制单人
        /// </summary>
        public string? Maker { get; set; }
        public List<PurchaseOrderProductDto> Products { get; set; }
    }

    public class PurchaseOrderProductDto
    {
        public string ProductId { get; set; }  // 确保类型为 string
        public int Quantity { get; set; }
        public string Batch { get; set; }
        public decimal UnitPrice { get; set; }
        public decimal? TotalPrice { get; set; } // 改为普通属性，移除计算表达式
    }
}
